package com.huobao.shangjia_version.activitys;

import java.util.ArrayList;
import java.util.List;

import org.xutils.view.annotation.ViewInject;

import com.ab.view.sliding.AbSlidingTabView;
import com.huobao.yunying.base.HuobaoBaseActivity;
import com.huobao.zhangying.R;

import android.app.Fragment;
import android.graphics.Color;

public class Act_Store_Progect_Manager extends HuobaoBaseActivity {

	@ViewInject(R.id.tabview)
	private AbSlidingTabView mAbSlidingTabView;

	private int pos = 0;
	@Override
	protected int getContentView() {
		return R.layout.layout_dingdan;
	}

	@Override
	protected String getTitleText() {
		return getString(R.string.title_7);
	}

	@Override
	protected void init() {
		pos = getIntent().getIntExtra("pos", 0);
		initView();
	}

	private void initView() {
		mAbSlidingTabView.getViewPager().setOffscreenPageLimit(5);
		mAbSlidingTabView.setTabTextColor(Color.BLACK);
		mAbSlidingTabView.setTabSelectColor(Color.rgb(30, 168, 131));
		mAbSlidingTabView.setTabBackgroundResource(R.drawable.tab_bg);
		mAbSlidingTabView.setTabLayoutBackgroundResource(R.mipmap.slide_top);
		mAbSlidingTabView.setTabPadding(20, 8, 20, 8);
		addRadio();
	}

	private void addRadio() {
		List<String> titles = new ArrayList<String>();
		List<Fragment> mFragments = new ArrayList<Fragment>();
		titles.clear();
		titles.add("出售中商品");
		mFragments.add(Store_ProgectManagerFragment.getInstant(""));
		titles.add("上架商品");
		mFragments.add(Store_ProgectManagerFragment.getInstant("1"));
		titles.add("已下架商品");
		mFragments.add(Store_ProgectManagerFragment.getInstant("0"));
		mAbSlidingTabView.addItemViews(titles, mFragments);
		mAbSlidingTabView.setTabPadding(20, 8, 20, 8);
		mAbSlidingTabView.getViewPager().setCurrentItem(pos);
	}

}
